<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<link rel="stylesheet" href="//at.alicdn.com/t/font_749785_8fz8gzaof52.css" />
		<link rel="stylesheet" href="http://style.iambuyer.com/css/simplePagination.css" />
		<!--<link rel="stylesheet" href="css/select.css" />-->
		<link rel="stylesheet" href="layui/css/layui.css" />
		<link rel="stylesheet" href="css/jquery.mCustomScrollbar.min.css" />
		<link rel="stylesheet" type="text/css" href="css/main.css"/>
		<style type="text/css">
			html,body{
				overflow-y: auto;
			}
			.cyd-logo{
				width: 246px;
			}
		</style>
	</head>
	<body>
		<div class="cyd-top">
			<div class="MinWidth cyd-top-cont">
				<div class="cyd-top-service">
					<a href="http://ruhexiu.com/" target="_blank"><img class="cyd-top-service-logo" src="http://style.iambuyer.com/img/ruhexiu-logo.png" /><span>如何秀</span></a>
					<a href="http://www.shuixiaoya.com/" target="_blank"><img class="cyd-top-service-logo" src="http://style.iambuyer.com/img/shuixiaoya-logo.png" /><span>税小鸭</span></a>
					<a href="http://iambuyer.com/" target="_blank"><img class="cyd-top-service-logo" src="http://style.iambuyer.com/img/mobai-logo.png" /><span>陌拜</span></a>
					<!--<a href="#" target="_blank"><img class="cyd-top-service-logo" src="http://style.iambuyer.com/img/rongzi-logo.png" /><span>融资</span></a>-->
				</div>
				<div class="cyd-top-join">
					<a href="http://www.shuixiaoya.com/index.php?m=Web&c=Index&a=scheme_every" target="_blank"><span class="cyd-top-join-bg">津</span>天津孵化器</a>
					<a href="http://www.shuixiaoya.com/index.php?m=Web&c=Index&a=FinancePlanningX" target="_blank"><span class="cyd-top-join-bg">苏</span>徐州孵化器</a>
					<a href="http://www.shuixiaoya.com/index.php?m=Web&c=Index&a=FinancePlanningM" target="_blank"><span class="cyd-top-join-bg">川</span>绵阳孵化器</a>
					<a href="http://www.shuixiaoya.com/index.php?m=Web&c=Index&a=FinancePlanningJ" target="_blank"><span class="cyd-top-join-bg">浙</span>金华孵化器</a>
					<a href="http://www.shuixiaoya.com/index.php?m=Web&c=Index&a=FinancePlanningG" target="_blank"><span class="cyd-top-join-bg">桂</span>桂林孵化器</a>
					<a href="http://www.shuixiaoya.com/index.php?m=Web&c=Index&a=FinancePlanningXY" target="_blank"><span class="cyd-top-join-bg">鄂</span>襄阳孵化器</a>
					<a href="#" target="_blank"><span class="cyd-top-join-bg">辽</span>沈阳孵化器</a>
				</div>
				<ul class="cyd-top-ul">
					<li class="cyd-top-items">快速入驻</li>
					<li class="cyd-top-items">生态服务</li>
					<li class="cyd-top-items">电话服务:
						<a class="cyd-top-tel">400-618-2288</a>
					</li>
				</ul>
			</div>
		</div>
		<div class="bigList-search">
			<div class="MinWidth cont">
				<img class="cyd-logo" src="http://style.iambuyer.com/img/cyd-logo.png" alt="logo" />
				<div class="list-search-cont">
					<div class="bigList-search-option">
						<span class="option-items on" id="comp">公司</span>
						<span>|</span>
						<span class="option-items" id="mainT">主营行业</span>
					</div>
					<input class="searchCont" id="searchCont" type="text" placeholder="请输入公司名称、主营行业" />
					<span class="searchBtn" onclick="qyList()">搜索</span>
				</div>
				<div class="list-erweima">
					<p>慧聪产业带公众号</p>
					<img class="cyd-erweima" src="http://style.iambuyer.com/img/erweima.png" alt="erweima" width="80" />
				</div>
			</div>
		</div>
		
		<!--content-->
		<div class="list-content">
			<div class="MinWidth">
				<div class="list-content-tip">
					<div>
						<span class="allResults">全部结果</span>
						<span class="resultItems"> > <span id="shuru"></span></span>
					</div>
					<div class="resultR">共找到<span style="color: #02C2A2;" id="result-num"></span>条搜索结果</div>
				</div>
				<!--option-->
				<div class="list-option">
					<ul>
						<li class="list-option-items layui-form">
							<select  lay-filter="fhq"  class="select" id="fhq"  lay-verify="type" name="business">
							    <!--<option value="" selected="selected">所有孵化器</option>
								<option value="11">桂林孵化器</option>
								<option value="15">金华孵化器</option>
								<option value="10">襄阳孵化器</option>
								<option value="14">绵阳孵化器</option>
								<option value="17">徐州孵化器</option>
								<option value="12">天津孵化器</option>
								<option value="9">沈阳孵化器</option>-->
							</select>
						</li>
						<li class="list-option-items">
							
						</li>
						<li class="list-option-items layui-form">
							<select  lay-filter="guimo"  class="select"  lay-verify="type" name="business"  >
								<option value="" selected="selected">企业规模</option>
								<option value="50人以下">50人以下</option>
								<option value="50-100人">50-100人</option>
								<option value="100-500人">100-500人</option>
								<option value="500-1000人">500-1000人</option>
								<option value="1000人以上">1000人以上</option>
							</select>
						</li>
						<li class="list-option-items layui-form">
							<select  lay-filter="shuishou"  class="select"  lay-verify="type" name="business"  >
								<option value="" selected="selected">预估年税收</option>
								<option value="0_9.9999">10万以下</option>
								<option value="10_49.9999">10万-50万</option>
								<option value="50_99.9999">50万-100万</option>
								<option value="100_499.9999">100万-500万</option>
								<option value="500_999.9999">500万-1000万</option>
								<option value="1000_999999.9999">1000万以上</option>
							</select>
						</li>
						<li class="list-option-items layui-form">
							<select  lay-filter="rongzi"  class="select"  lay-verify="type" name="business"  >
								<option value="" selected="selected">融资阶段</option>
								<option value="自有资金">自有资金</option>
								<option value="天使轮">天使轮</option>
								<option value="A轮">A轮</option>
								<option value="B轮">B轮</option>
								<option value="C轮">C轮</option>
								<option value="D轮">D轮</option>
								<option value="已上市">已上市</option>
							</select>
						</li>
						<!--<li class="list-option-items layui-form" style="float: right; border-left: 1px solid #e2e2e2;">
							<select  lay-filter="paixu"  class="select"  lay-verify="type" name="business"  >
								<option value="UPDATE_TIME" selected="selected">按入驻时间</option>
								<option value="CAST(COMP_REGMONEY as SIGNED)">按注册资金</option>
								<option value="CAST(COMP_YEAR_TAX as SIGNED)">按预估年税收</option>
							</select>
						</li>-->
					</ul>
				</div>
				<!--desc-->
				<div class="list-desc">
					<ul>
						<li>排序：</li>
						<li class="list-desc-items on joinTime">入驻时间</li>
						<li class="list-desc-items regMoney">注册资金</li>
						<li class="list-desc-items textMake">预估年税收</li>
					</ul>
				</div>
				<!--cont-->
				<div class="list-cont"></div>
				<!--cont end-->
				
				<!--分页-->
				<div id="light-pagination" class="pagination"></div>
			</div>
		</div>
		<!--foot-->
		<div class="cyd-foot">
			<div class="MinWidth cyd-foot-cont">
				<img class="cyd-foot-logo" src="http://style.iambuyer.com/img/cyd-logo-hui.png" alt="logo" />
				<div class="cyd-foot-R">
					<div class="cyd-foot-fuwus">
						<p class="cyd-foot-fuwus-title">我们的服务商</p>
						<p class="cyd-foot-fuwus-text">
							<a href="http://www.shuixiaoya.com/" target="_black">税小鸭</a>
						</p>
						<p class="cyd-foot-fuwus-text">
							<a href="http://ruhexiu.com/" target="_black">如何秀</a>
						</p>
						<p class="cyd-foot-fuwus-text">
							<a href="http://iambuyer.com/" target="_black">陌拜</a>
						</p>
					</div>
					<div>
						<p class="cyd-foot-call">联系我们</p>
						<p class="cyd-foot-call-icon"><i class="iconfont icon-9"></i>合作热线</p>
						<p class="cyd-foot-tell">400-618-2288（工作日8:30-18:00）</p>
						<p class="cyd-foot-add-icon"><i class="iconfont icon-dizhi1"></i>公司地址</p>
						<p class="cyd-foot-tell">北京市昌平区回龙观七里渠慧聪园总部基地</p>
					</div>
					<div class="cyd-foot-erweima">
						<img src="http://style.iambuyer.com/img/erweima.png" alt="二维码" />
						<p class="cyd-foot-erweima-ms">扫码关注<br />产业带官方公众号</p>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script src="js/jquery.min.js"></script>
	<script src="http://style.iambuyer.com/js/layer/layer.js"></script>
	<script src="http://style.iambuyer.com/js/home/jquery.simplePagination.js"></script>
	<!--<script src="js/jquery.select.js"></script>-->
	<script src="layui/layui.js"></script>
	<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
	<script src="js/config.js"></script>
	<script type="text/javascript">
//		var ajaxUrl = 'http://manage.ruhexiu.com/';
		var page = 1;
		var isInchOrName = 0; //0代表公司 1代表主营行业
		var compName = '';
		var pCode = '';
		var cCode = '';
		var yearTxtStr = '';
		var compScale = '';
		var compFina = '';
		var compIndu = '';
		var incuId = window.location.search.split("=")[1];
		var orderStr = 'UPDATE_TIME';
		var order = 'desc';
		var count = '';
		
		// 企业切换
		$("#comp").click(function(){
			isInchOrName = 0;
			$(this).addClass("on").siblings().removeClass("on");
			console.log(isInchOrName)
		})
		$("#mainT").click(function(){
			isInchOrName = 1;
			$(this).addClass("on").siblings().removeClass("on");
			console.log(isInchOrName)
		})
		
		// 展开收起
		$("body").delegate(".result-close", 'click', function(){
			$(this).hide()
		})
		$("body").on('click', ".result-open", function(){
			$(this).siblings().removeClass("on")
			$(this).hide()
			$(this).parent().find(".result-close").show()
		})
		$("body").on('click', ".result-close", function(){
			$(this).siblings().addClass("on")
			$(this).hide()
			$(this).parent().find(".result-open").show()
		})
		
		// 排序
		$(".list-desc-items").click(function(){
			$(this).addClass("on").siblings().removeClass("on")
		});
		$(".joinTime").click(function(){
			orderStr = "UPDATE_TIME";
			page = 1;
		    qyList();
		    pagination();
		});
		$(".regMoney").click(function(){
			orderStr = "CAST(COMP_REGMONEY as SIGNED)";
			page = 1;
		    qyList();
		    pagination();
		});
		$(".textMake").click(function(){
			orderStr = "CAST(COMP_YEAR_TAX as SIGNED)";
			page = 1;
		    qyList();
		    pagination();
		});
		
		// 实时监听搜索框变化
		var otxt=document.getElementById("searchCont");
		  if(document.all){
		     otxt.onpropertychange=function(){
		       $("#shuru").html($(".searchCont").val().trim())
		     }
		  }
		  else{
		    otxt.oninput=function(){
		      $("#shuru").html($(".searchCont").val().trim())
		    }
		  }
		
		// 回车出发搜索
		$('#searchCont').bind('keydown',function(event){
		    if(event.keyCode == "13") {
		    	page = 1;
		        qyList();
		        pagination();
		    }
		});
		
		// 通过请求动态加载渲染的layui数据需要调用此方法
		function renderForm(){
		  layui.use('form', function(){
		   var form = layui.form;
		   form.render();
		  });
		}

		// change
		layui.use('form', function(){
			var form = layui.form, layer = layui.layer;
			form.on('select(fhq)', function(data){
			    incuId = data.value;
			    page = 1;
			    qyList();
			    pagination()
			});
			form.on('select(guimo)', function(data){
				compScale = data.value;
				page = 1;
				qyList();
				pagination()
			});
			form.on('select(shuishou)', function(data){
				yearTxtStr = data.value;
				page = 1;
				qyList();
				pagination()
			});
			form.on('select(rongzi)', function(data){
				compFina = data.value;
				page = 1;
				qyList();
				pagination()
			});
//			form.on('select(paixu)', function(data){
//				orderStr = data.value;
//				page = 1;
//				qyList();
//				pagination()
//			});
		});
		
		//孵化器list
		$.ajax({
			type:"get",
			url:url+"wrmanage/cydIncubator/restList",
			dataTypt: 'json',
			async: true,
			success: function(res){
				var data = res.content.list
				console.log(data)
				var html = '<option value="" selected="selected">所有孵化器</option>'
				for (var i in data) {
					html += '<option value="'+data[i].id+'">'+data[i].name+'</option>'
				}
				console.log(html)
				$("#fhq").html(html)
				renderForm();
			},
			error: function(){
				layer.msg('error');
			}
		});
		
		//ajax
		function qyList(){
			let index = layer.load(2, {shade: false});
			let html = '';
			$.ajax({
				type:"post",
				url:url+"wrmanage/cydApplyComp//api/list?page="+page,
				data:JSON.stringify({
					isInchOrName: isInchOrName,
					compName: $(".searchCont").val().trim(),
					pCode: '',
					cCode: '',
					yearTxtStr: yearTxtStr,
					compScale: compScale,
					compFina: compFina,
					orderStr: orderStr,
					order: order,
//					compIndu: $(".searchCont").val().trim(),
					incuId: incuId
				}),
				contentType: 'application/json;charset=UTF-8',
				success: function(res) {
					layer.close(index); //关闭loading
					console.log(res);
					let data = res.content;
					let list = data.list
					count = data.count;
					$("#result-num").html(count);
					if (count == 0) {
						html+= '<div class="list-empty">没有相关数据</div>'
						$(".list-cont").html(html)
					} else{
						for (let i in list) {
							if (list[i].compLogo) {
								html+= '<div class="result-items">'+'<div class="result-items-top">'+
											'<div class="result-logo on"><img src="'+list[i].compLogo+'" width="100%" /></div>'+
											'<div class="result-items-top-R">'+
												'<div class="result-items-title"><span class="result-items-tt">'+list[i].compName+'</span><span class="result-items-Icon">行</span><span class="result-items-title-sm">'+list[i].compIndu+'</span></div>'+
												'<div class="result-items-top-ms">'+
													'<span>'+list[i].compFina+'</span>'+
													'<span class="line-S">|</span>'+
													'<span>'+list[i].compScale+'</span>'+
													'<span class="line-S">|</span>'+
													'<span>'+list[i].compAddrs+'</span>'+
												'</div>'+
												'<div class="result-items-top-ms">'+
													'<span>注册资金：</span>'+
													'<span class="color-cyd">'+list[i].compRegmoney+'万元</span>'+
													'<span class="margin-left60">预估年税收：</span>'+
													'<span class="color-cyd">'+(list[i].compYearTax? list[i].compYearTax : '— —')+'万元</span>'+
												'</div>'+
												'<div class="result-items-top-ms">'+
													'<span class="color-cyd">提供服务：</span>'+
													'<span class="color-h">'+(list[i].compResServ? list[i].compResServ : "无")+'</span>'+
												'</div>'+
												'<div class="result-items-top-ms">'+
													'<span class="color-yellow">所需服务：</span>'+
													'<span class="color-h">'+(list[i].compReqServ? list[i].compReqServ : "无")+'</span>'+
												'</div>'+
											'</div>'+
										'</div>'+
										'<div class="result-items-bottom">'+
											'<p class="result-items-bottom-t on">'+(list[i].compContent? list[i].compContent : "无")+'</p>'+
											'<span class="result-close">收起</span>'+
											'<span class="result-open">展开</span>'+
										'</div>'+
										'</div>'
							} else{
								html+= '<div class="result-items">'+'<div class="result-items-top">'+
											'<div class="result-logo">徐</div>'+
											'<div class="result-items-top-R">'+
												'<div class="result-items-title"><span class="result-items-tt">'+list[i].compName+'</span><span class="result-items-Icon">行</span><span class="result-items-title-sm">'+list[i].compIndu+'</span></div>'+
												'<div class="result-items-top-ms">'+
													'<span>'+list[i].compFina+'</span>'+
													'<span class="line-S">|</span>'+
													'<span>'+list[i].compScale+'</span>'+
													'<span class="line-S">|</span>'+
													'<span>'+list[i].compAddrs+'</span>'+
												'</div>'+
												'<div class="result-items-top-ms">'+
													'<span>注册资金：</span>'+
													'<span class="color-cyd">'+list[i].compRegmoney+'万元</span>'+
													'<span class="margin-left60">预估年税收：</span>'+
													'<span class="color-cyd">'+(list[i].compYearTax? list[i].compYearTax : '— —')+'万元</span>'+
												'</div>'+
												'<div class="result-items-top-ms">'+
													'<span class="color-cyd">提供服务：</span>'+
													'<span class="color-h">'+(list[i].compResServ? list[i].compResServ : "无")+'</span>'+
												'</div>'+
												'<div class="result-items-top-ms">'+
													'<span class="color-yellow">所需服务：</span>'+
													'<span class="color-h">'+(list[i].compReqServ? list[i].compReqServ : "无")+'</span>'+
												'</div>'+
											'</div>'+
										'</div>'+
										'<div class="result-items-bottom">'+
											'<p class="result-items-bottom-t on">'+(list[i].compContent? list[i].compContent : "无")+'</p>'+
											'<span class="result-close">收起</span>'+
											'<span class="result-open">展开</span>'+
										'</div>'+
										'</div>'
							}
						}
						$(".list-cont").html(html)
					}
					
					// 
					$(".result-close").hide();
//					if ($(".result-items-bottom-t").html().length<73) {
//						$(".result-open").hide();
//					}
				},
				error: function() {
					html+= '<div class="list-empty">服务器出错了</div>'
						$(".list-cont").html(html)
					layer.close(index);
				}
			});
		};
		qyList();
		
		// 分页
		function pagination(){
			setTimeout(function(){
				console.log("分页")
				$('#light-pagination').pagination({
					pages: Math.ceil(count / 10),
					cssStyle: 'light-theme',
					displayedPages: 3,
					edges: 3,
					onPageClick: function(pageNumber, event) {
						// Callback triggered when a page is clicked
						// Page number is given as an optional parameter
						console.log(pageNumber)
						page = pageNumber;
						qyList();
					},
				});
			}, 500)
		}
		pagination()
	</script>
</html>
